Skip to content

fix(settings): keep no database connection in a web process under uvicorn - #1203

Open
tintinhamans wants to merge 1 commit into
ctrliq:mainfrom
community-outpost:fix/asgi-no-connection-reuse
Open

tintinhamans wants to merge 1 commit into
ctrliq:mainfrom
community-outpost:fix/asgi-no-connection-reuse

Conversation

@tintinhamans

@tintinhamans tintinhamans commented Nov 13, 2026 •

Copy link
Copy Markdown
SUMMARY

Under uvicorn every request runs in its own thread, so #946's 60 second CONN_MAX_AGE for web processes leaves a connection behind with each one. On our instance the web workers ended up holding 87 of 100 connections and the API started returning 500s.

Web processes are back on Django's default of 0. DATABASE_CONN_MAX_AGE still overrides it. This brings back the per-request connect that #946 measured; Django's connection pool is the way to get reuse back under ASGI, I'll do that in a follow-up.

Full API suite, migrations and linters pass locally on PostgreSQL 18.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API
ASCENDER VERSION
25.6.4.dev37+g311042b0c

Assisted-by: Claude Opus 5.5

…corn

Signed-off-by: tintinhamans <5984296+tintinhamans@users.noreply.github.com>
@tintinhamans
tintinhamans marked this pull request as draft November 13, 2026 18:53
@tintinhamans
tintinhamans marked this pull request as ready for review November 13, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant